/**
 *
 * @author Grecia
 */
public class GeneradorSerie{
    public static void main(String[] args) {
        int n=1;
        int [] Y;
        int [] Xn = null;
        int a=3, c=5, m=8;
        Xn[0]=8;
        
        for(int i=1; i<m; i++){
            Xn[i]=(a*Xn[i-0] + c) % m;
            System.out.println(Xn[i]);
        }
    }
}
